package com.github.prontera.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.prontera.domain.SystemDiamond;
import com.github.prontera.persistence.CrudMapper;
import com.github.prontera.persistence.SystemDiamondMapper;

/**
 * 系统账户-->唐钻
 */
@Service
public class SystemDiamondService extends CrudServiceImpl<SystemDiamond>{
    
	@Autowired
	private SystemDiamondMapper mapper;
	
  	@Autowired
    public SystemDiamondService(CrudMapper<SystemDiamond> mapper) {
        super(mapper);
    }

	public boolean insertDiamond(Long clientId, Long productId, Integer bean, Integer type) {
		SystemDiamond systemBean=new SystemDiamond();
		systemBean.setDiamond(bean);
		systemBean.setProductId(productId);
		systemBean.setClientId(clientId);
		systemBean.setType(type);
		return insert(systemBean)>0;
	}
  	
	public boolean updateDiamond(SystemDiamond systemDiamond) {
		return mapper.updateDiamond(systemDiamond)>0;
	}
  	
}
